package com.eastfair.venuebooking.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.eastfair.boot.request.PageParams;
import com.eastfair.boot.service.SuperService;
import com.eastfair.venuebooking.dto.QuotationDTO;
import com.eastfair.venuebooking.dto.QuotationQuery;
import com.eastfair.venuebooking.entity.Quotation;
import com.eastfair.venuebooking.vo.PriceListSpaceVO;
import com.eastfair.venuebooking.vo.QuotationVO;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 业务接口
 * 报价书
 * </p>
 *
 * @author linan
 * @date 2022 -06-08
 */
public interface QuotationService extends SuperService<Quotation> {

    /**
     * 分页查询报价记录.
     *
     * @param pageParams the page params
     * @return the page
     */
    IPage<QuotationVO> listQuotationVOs(PageParams<QuotationQuery> pageParams);

    /**
     * 通过报价书id查询场地价目.
     *
     * @param quotationId the quotation id
     * @return the list
     */
    List<PriceListSpaceVO> listPriceListSpacesByQuotationId(Long quotationId);

    /**
     * 查询可用于添加合同的报价书列表.
     *
     * @param exhibitionId the exhibition id
     * @return the list
     */
    List<QuotationVO> listForContractManage(Long exhibitionId);

    /**
     * 展会ID查询报价书列表.
     *
     * @param exhibitionId the exhibition id
     * @return the list
     */
    List<Quotation> listQuotationsByExhibitionId(Long exhibitionId);

    /**
     * 查询报价书列表.
     *
     * @param quotationDTO the quotation dto
     * @return the list
     */
    List<Quotation> listQuotation(QuotationDTO quotationDTO);

    /**
     * id 查询详情.
     *
     * @param id the id
     * @return the quotation vo
     */
    QuotationVO getQuotationVOById(Long id);

    /**
     * 保存报价书.
     *
     * @param quotationDTO the quotation dto
     * @return the boolean
     */
    boolean saveQuotation(QuotationDTO quotationDTO);

    /**
     * 新增展会报价.
     *
     * @param quotationDTO the quotation dto
     * @return the boolean
     */
    boolean saveExhibitionQuotation(QuotationDTO quotationDTO);

    /**
     * 更新报价书.
     *
     * @param quotationDTO the quotation dto
     * @return the boolean
     */
    boolean updateQuotation(QuotationDTO quotationDTO);

    /**
     * ID列表批量删除报价书.
     *
     * @param ids the ids
     * @return the boolean
     */
    boolean removeQuotationByIds(List<Long> ids);

    /**
     * 删除报价书详情，并更新报价书信息.
     *
     * @param quotationDTO the quotation dto
     * @return the boolean
     */
    @Deprecated
    boolean removeQuotationDetail(QuotationDTO quotationDTO);

    /**
     * 通过展会ID移除报价书.
     *
     * @param exhibitionId the exhibition id
     * @return the boolean
     */
    boolean removeQuotationByExhibitionId(Long exhibitionId);

    /**
     * 批量ID更新报价书为失效.
     *
     * @param ids the ids
     * @return the boolean
     */
    boolean updateQuotationDisableByIds(List<Long> ids);

    /**
     * 展会ID更新报价书为失效.
     *
     * @param exhibitionId the exhibition id
     * @return the boolean
     */
    boolean updateQuotationDisableByExhibitionId(Long exhibitionId);

    /**
     * 验证办展天数与报价计价时长是否相符.
     *
     * @param quotationDTO the quotation dto
     * @return the map (key:exhibitionPeriod,value:展会办展天数; key:match,value:办展天数与报价计价时长是否相符)
     */
    Map<String, Object> validQuotationPriceDuration(QuotationDTO quotationDTO);

    /**
     * 查询报价书的所有展厅
     * @param query
     * @return
     */
    List<PriceListSpaceVO> queryAllSpace(QuotationQuery query);
}
